package com.yunzhi.net.interceptor;

import android.util.Log;

import okhttp3.logging.HttpLoggingInterceptor;

/**
 * Author by Mr.Meng
 * created 2019/5/15
 *
 * @desc
 */
public class LoggingInterceptor {


    public static HttpLoggingInterceptor getLoggingInterceptor() {
        //日志拦截器
        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> {
//            try {
//                String text = URLDecoder.decode(message, "utf-8");
                Log.d("dslive", "OKHttp-----> " + message);


           /* } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
                Log.d("dslive", "OKHttp-----> " + message);
            }*/


        });

        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);

        return interceptor;


    }
}
